Skip to content

feat: Slack AI 스레드 댓글 및 대화 이력 기능 추가(재PR)#382

Merged
JanooGwan merged 1 commit intodevelopfrom
fix/slack-ai-v2
Mar 12, 2026
Merged

feat: Slack AI 스레드 댓글 및 대화 이력 기능 추가(재PR)#382
JanooGwan merged 1 commit intodevelopfrom
fix/slack-ai-v2

Conversation

@JanooGwan
Copy link
Contributor

🔍 개요

  • close #이슈번호

🚀 주요 변경 내용


💬 참고 사항


✅ Checklist (완료 조건)

  • 코드 스타일 가이드 준수
  • 테스트 코드 포함됨
  • Reviewers / Assignees / Labels 지정 완료
  • 보안 및 민감 정보 검증 (API 키, 환경 변수, 개인정보 등)

@JanooGwan JanooGwan self-assigned this Mar 12, 2026
@JanooGwan JanooGwan added the 버그 정상적으로 동작하지 않는 문제 상황 관련 이슈입니다. label Mar 12, 2026
@coderabbitai
Copy link

coderabbitai bot commented Mar 12, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 23f1f45d-a5c9-45e7-87d2-d75b141b7fd0

📥 Commits

Reviewing files that changed from the base of the PR and between 4d0ebaf and 7eb92d9.

📒 Files selected for processing (6)
  • src/main/java/gg/agit/konect/infrastructure/slack/ai/SlackAIService.java
  • src/main/java/gg/agit/konect/infrastructure/slack/ai/SlackEventController.java
  • src/main/java/gg/agit/konect/infrastructure/slack/client/SlackClient.java
  • src/main/java/gg/agit/konect/infrastructure/slack/config/SlackProperties.java
  • src/main/resources/application-db.yml
  • src/main/resources/application-infrastructure.yml

📝 Walkthrough

개요

Slack AI 응답에 스레드 인식 기능을 추가하여, 봇이 스레드 내 메시지 이력을 수집하고 컨텍스트를 포함한 응답을 생성할 수 있도록 개선했습니다. SlackClient에 스레드 관련 API 메서드를 추가하고, SlackAIService의 메서드 서명을 확장했으며, 봇 토큰 설정을 추가했습니다.

변경 사항

코호트 / 파일(들) 요약
Slack 스레드 처리 코어
src/main/java/gg/agit/konect/infrastructure/slack/ai/SlackAIService.java
스레드 인식 AI 응답 흐름 추가: fetchAIThreadReplies로 스레드 처리 여부 결정, processAIQuery 서명 확장(channelId, threadTs, cachedReplies), buildConversationHistory로 이력 변환, postThreadReply로 스레드 응답 전송.
Slack 이벤트 처리
src/main/java/gg/agit/konect/infrastructure/slack/ai/SlackEventController.java
스레드 컨텍스트 추출 및 검증 로직 강화: effectiveThreadTs 계산, 시그니처 검증, 중복 이벤트 방지, 스레드별 AI 처리 경로 확장, 봇 메시지 필터링.
Slack API 통신
src/main/java/gg/agit/konect/infrastructure/slack/client/SlackClient.java
스레드 관련 공개 메서드 추가: postThreadReply(채팅 전송), getThreadReplies(스레드 메시지 조회), 복구 메서드, ObjectMapper 및 SlackProperties 의존성 추가, parseSlackResponse 헬퍼 메서드 구현.
설정 및 리소스
src/main/java/gg/agit/konect/infrastructure/slack/config/SlackProperties.java, src/main/resources/application-db.yml, src/main/resources/application-infrastructure.yml
SlackProperties에 botToken 필드 추가, 데이터베이스 타임존(Asia/Seoul) 설정 추가, Slack 봇 토큰 환경 변수 설정 추가.

시퀀스 다이어그램

sequenceDiagram
    participant Controller as SlackEventController
    participant AIService as SlackAIService
    participant Client as SlackClient
    participant Claude as ClaudeClient
    
    Controller->>Controller: 이벤트 검증 & 컨텍스트 추출
    Controller->>AIService: processAIQuery(text, channelId, threadTs, cachedReplies)
    
    alt 스레드 존재 & AI 회신 없음
        AIService->>Client: fetchAIThreadReplies(channelId, threadTs)
        Client-->>AIService: 스레드 메시지 목록
    end
    
    AIService->>AIService: buildConversationHistory(threadReplies)
    AIService->>Claude: 대화 이력 포함 AI 요청
    Claude-->>AIService: AI 응답
    
    AIService->>Client: postThreadReply(channelId, threadTs, response)
    Client-->>AIService: 성공/실패
Loading

코드 리뷰 예상 시간

🎯 3 (Moderate) | ⏱️ ~25 분

관련 PR

제안 라벨

기능

래빗의 시

🐰 스레드를 따라 AI는 춤을 추고
대화의 이력을 모두 담아
슬랙의 메시지 사이로
더 똑똑한 답변을 전하네
스레드와 함께 한 걸음 더!

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/slack-ai-v2

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@JanooGwan JanooGwan merged commit ef282cc into develop Mar 12, 2026
1 of 2 checks passed
@JanooGwan JanooGwan deleted the fix/slack-ai-v2 branch March 12, 2026 07:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

버그 정상적으로 동작하지 않는 문제 상황 관련 이슈입니다.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant